<#if !addressHtmlId??>
	<!-- 定义表单id（也是整个编辑模版标识） -->
	<#assign addressHtmlId = "addressHtmlId">
</#if>
<#if !addressWidth??>
	<!-- 定义下拉框宽度 -->
	<#assign addressWidth = "159">
</#if>
<script>
function selectProvince${addressHtmlId}(value) {
//		$.get('/City/GetCitysByProvinceName', { provinceName: newValue }, function (data) {
//         city.combobox("clear").combobox('loadData', data);
//         district.combobox("clear")
//     }, 'json');
	$('#cityCombobox${addressHtmlId}').combobox("clear").combobox('reload','city.do?loadComboBox&provinceId='+value.value);
	$('#districtCombobox${addressHtmlId}').combobox("clear");
//		$('#websiteStateProvince').val(value.name);
	setStateProvince${addressHtmlId}();
}
function selectCity${addressHtmlId}(value) {
	$('#districtCombobox${addressHtmlId}').combobox("clear").combobox('reload','district.do?loadComboBox&cityId='+value.value);
//		var provinceName = $('#provinceCombobox${addressHtmlId}').combobox("getText");
//		$('#websiteStateProvince').val(provinceName+value.name);
	setStateProvince${addressHtmlId}();
}

function selectDistrict${addressHtmlId}(value) {
	setStateProvince${addressHtmlId}();
}

function setStateProvince${addressHtmlId}() {
	var provinceName = $('#provinceCombobox${addressHtmlId}').combobox("getText");
	var cityName = $('#cityCombobox${addressHtmlId}').combobox("getText");
	var districtName = $('#districtCombobox${addressHtmlId}').combobox("getText");
	var addressText = provinceName+cityName+districtName;
	<#if callbackFun?exists>
		<@callbackFun />
	<#else>
		
	</#if>
// 	$('#websiteStateProvince').val(provinceName+cityName+districtName);
}
</script>
<tr>
	<td>
		省份
	</td>
	<td>
		<@eu.comboBox id="provinceCombobox${addressHtmlId}" width="${addressWidth}" url="province.do?loadComboBox" onSelect="selectProvince${addressHtmlId}(value)"/>
	</td>
	<td>
		城市
	</td>
	<td>
		<@eu.comboBox id="cityCombobox${addressHtmlId}" width="${addressWidth}" url="city.do?loadComboBox"  onSelect="selectCity${addressHtmlId}(value)"/>
	</td>
	<td>
		县区
	</td>
	<td>
		<@eu.comboBox id="districtCombobox${addressHtmlId}" width="${addressWidth}" url="district.do?loadComboBox"  onSelect="selectDistrict${addressHtmlId}(value)"/>
	</td>
</tr>